
export default {
    qtQuest: (params) => {
        return new Promise((resolve, reject) => {
            if (!window.qt) reject()
            try {
                new window.QWebChannel(window.qt.webChannelTransport, function (channel) {
                    //content是qt的接口对象
                    var content = channel.objects.qtObject //channel.objects是固有的，不用改，后面的document是在MainWidget种注册的对象名
                    content.webMsgEvent.connect((res) => resolve(res))
                    content.onJsonMsg(params)
                })
            } catch (error) {
                reject(error);
            }
        })
    }
}